package com.ruoyi.basedata.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 大档案对象 t_terminals_db
 *
 * @author ruoyi
 * @date 2023-09-07
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("t_terminals_db")
public class TerminalsDb extends BaseDO {
    private static final long serialVersionUID = 1L;

    /**
     * 自增主键
     */
    @TableId
    private Long id;

    /**
     * 设备归属水司
     */
    @TableField("tenant_id")
    @Excel(name = "客户编号")
    private String tenantId;

    /**
     * 设备名称
     */
    @Excel(name = "设备名称")
    @TableField("terminal_name")
    private String terminalName;

    /**
     * 设备编号
     */
    @Excel(name = "设备编号")
    @TableField("terminal_id")
    private String terminalId;

    /**
     * 表状态（0-停用, 1-使用）
     */
    @Excel(name = "表状态", readConverterExp = "0=停用,1=使用")
    @TableField("terminal_mark")
    private Integer terminalMark;

    /**
     * 表型号id
     */
    @Excel(name = "表型号", dictType = "module_type")
    @TableField("type_id")
    private String typeId;

    /**
     * 表底数
     */
    @Excel(name = "表底数")
    @TableField("base_reading")
    private BigDecimal baseReading;

    /**
     * 厂家编号
     */
    @Excel(name = "厂家名称", dictType = "terminal_supplier")
    @TableField("supplier_id")
    private String supplierId;

    /**
     * 安装日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "安装日期", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("install_date")
    private Date installDate;

    /**
     * 安装地址
     */
    @Excel(name = "安装地址")
    @TableField("install_address")
    private String installAddress;

    /**
     * imei
     */
    @Excel(name = "IMEI")
    @TableField("imei")
    private String imei;

    /**
     * sim卡号
     */
    @Excel(name = "SIM卡号")
    @TableField("sim_num")
    private String simNum;

    /**
     * 钢印/塑封号
     */
    @Excel(name = "钢印/塑封号")
    @TableField("plastic_seal_no")
    private String plasticSealNo;

    /**
     * 出厂编号
     */
    @Excel(name = "出厂编号")
    @TableField("first_supplier_id")
    private String firstSupplierId;

    /**
     * 是否带阀控(0：否，1：是)
     */
    @Excel(name = "是否带阀控", dictType = "yes_no")
    @TableField("valve_control")
    private Long valveControl;

    /**
     * 阀门地址
     */
    @Excel(name = "阀门地址")
    @TableField("valve_address")
    private String valveAddress;

    /**
     * 出厂日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出厂日期", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("manufacture_date")
    private Date manufactureDate;

    /**
     * 口径大小
     */
    @Excel(name = "口径大小", dictType = "ldbd_pipe_caliber")
    @TableField("caliber")
    private String caliber;

    /**
     * 采集频率(分钟)
     */
    @Excel(name = "采集频率(分钟)")
    @TableField("reading_frequency")
    private Long readingFrequency;

    /**
     * 上传频率(分钟)
     */
    @Excel(name = "上传频率(分钟)")
    @TableField("up_frequency")
    private Long upFrequency;

    /**
     * 位置识别编号
     */
    @Excel(name = "位置识别编号")
    @TableField("location_nb")
    private String locationNb;


    @TableField(exist = false)
    private String protocolName;

    /**
     * 协议id
     */
    @TableField("protocol_id")
    @Excel(name = "协议ID(1:德高netty,6:东剑9095)")
    private String protocolId;

    /**
     * 通讯地址
     */
    @Excel(name = "通讯地址")
    @TableField("communicate_address")
    private String communicateAddress;

    /**
     * sim卡类型
     */
    @TableField("sim_type")
    private String simType;

    /**
     * 月冻结日期1-28
     */
    @TableField("freezedate_month")
    private Long freezedateMonth;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableField("del_flag")
    private Long delFlag;

    /**
     * 计量电压类型
     */
    @TableField("voltage_type")
    private String voltageType;

    /**
     * 计量电压
     */
    @TableField("metered_voltage")
    private BigDecimal meteredVoltage;

    /**
     * 瞬时流量计算方式
     */
    @TableField("instantaneous_js_fs")
    private String instantaneousJsFs;

    /**
     * aep平台的唯一码
     */
    @TableField("device_id")
    private String deviceId;

    /**
     * 是否带压力功能(1为是,0为否)
     */
    @TableField("pressure_display")
    @Excel(name = "是否带压力功能", dictType = "yes_no")
    private Integer pressureDisplay;

    /**
     * 经度
     */
    @Excel(name = "经度")
    @TableField("lng")
    private String lng;

    /**
     * 纬度
     */
    @Excel(name = "纬度")
    @TableField("lat")
    private String lat;

    /**
     * 经纬度
     */
    @TableField("lng_lat_temp")
    private String lngLatTemp;

    /**
     * 新表底数-表更换用
     */
    @TableField(exist = false)
    private BigDecimal baseReadingNew;

    /**
     * 新IMEI-表更换用
     */
    @TableField(exist = false)
    private String imeiNew;

    /**
     * 新设备编号-表更换用
     */
    @TableField(exist = false)
    private String terminalIdNew;

    /**
     * 新设备编号-表更换用
     */
    @TableField(exist = false)
    private String changeRemark;

    @TableField(exist = false)
    private Integer treeType = 4;

    /**
     * 安装日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private Date createTime;

    @TableField(exist = false)
    private String typeName;

    @Excel(name = "备注")
    @TableField("remark")
    private String remark;

    @Excel(name = "用户编号")
    @TableField("user_id")
    private String userId;

    @Excel(name = "区域编号")
    @TableField("sheets_code")
    private String sheetsCode;


    @TableField("sheets_id")
    private Integer sheetsId;

    @TableField(exist = false)
    private Long loginUserId;

    @TableField(exist = false)
    private Integer systemFlag;

    @Excel(name = "注册平台",dictType = "sign_platform")
    @TableField("sign_platform")
    private Integer signPlatform;

    @TableField(exist = false)
    private String imsi;

    @TableField(exist = false)
    private String deptName;
    /**
     * 适用策略
     */
    @TableField("strategy")
    private String strategy;
    /**
     * 适用策略名称
     */
    @Excel(name = "适用策略")
    @TableField(exist = false)
    private String strategyName;

    @Excel(name = "通讯类型", useDictSelectOption = true, dictType = "communication_type")
    @TableField("communication_type")
    private String communicationType;

    @TableField("communication_config")
    private String communicationConfig;


    @TableField("valve_status")
    private Integer valveStatus;

    /**
     * 协议解析类名
     */
    @TableField(exist = false)
    private String protocolClassName;
}
